#include "load_model.h"

#include <stdio.h>

// model loading
int save_model(LeNet5* lenet, const char* filename)
{
	FILE* fp = fopen(filename, "wb");
	if (!fp) return 1;
	fwrite(lenet, sizeof(LeNet5), 1, fp);
	fclose(fp);
	return 0;
}

// model loading
int load_model(LeNet5* lenet, const char* filename)
{
	FILE* fp = fopen(filename, "rb");
	if (!fp) return 1;
	fread(lenet, sizeof(LeNet5), 1, fp);
	fclose(fp);
	return 0;
}
